/**
 * Created by Administrator on 2017/1/21.
 */

var MJ = require('../MJ/MJ');

var ScoreRule = clone(MJ.ScoreRule);
ScoreRule.MenQing = 201;        // 门清
ScoreRule.QingYiSe = 202;       // 清一色
ScoreRule.ZiYiSe = 203;         // 字一色
ScoreRule.Pair7 = 204;          // 七对
ScoreRule.H1Pair7 = 205;        // 豪华七对
ScoreRule.H2Pair7 = 206;        // 双豪华七对
ScoreRule.ZiYiSePair7 = 207;        // 字一色七大对
ScoreRule.QingYiSePair7 = 208;        // 清一色七对
ScoreRule.YiTiaoLong = 209;            // 一条龙
ScoreRule.QingYiSeYiTiaoLong = 210;        // 清龙

ScoreRule.GuJiang = 211;        // 孤将
ScoreRule.YiZhangYing = 212;    // 一张赢

ScoreRule.SanYuan1 = 213;        // 三元
ScoreRule.SanYuan2 = 214;        // 三元
ScoreRule.SanYuan3 = 215;        // 三元
ScoreRule.SanYuan4 = 216;        // 三元

ScoreRule.SanFeng1 = 217;        // 三风
ScoreRule.SanFeng2 = 218;        // 三风
ScoreRule.SanFeng3 = 219;        // 三风
ScoreRule.SanFeng4 = 220;        // 三风

ScoreRule.QueMen1 = 221;         // 缺门
ScoreRule.QueMen2 = 222;         // 缺门

ScoreRule.QingYiSeH1Pair7 = 223;         // 清一色豪华七对

var SanFeng = {};
SanFeng[1] = ScoreRule.SanFeng1;
SanFeng[2] = ScoreRule.SanFeng2;
SanFeng[3] = ScoreRule.SanFeng3;
SanFeng[4] = ScoreRule.SanFeng4;
var SanYuan = {};
SanYuan[1] = ScoreRule.SanYuan1;
SanYuan[2] = ScoreRule.SanYuan2;
SanYuan[3] = ScoreRule.SanYuan3;
SanYuan[4] = ScoreRule.SanYuan4;

var ZMSanYuan = {};
ZMSanYuan[1] = 2;
ZMSanYuan[2] = 7;
ZMSanYuan[3] = 15;
ZMSanYuan[4] = 31;

var Gap = {};
Gap[1] = ScoreRule.QueMen1;
Gap[2] = ScoreRule.QueMen2;
Gap[3] = ScoreRule.QueMen2;


//基础牌型
var Pattern = {
    'NONE': 0,                // 不是可胡的牌型
    'NORMAL': 1,              // 平胡
    'PAIR': 2,                // 大对
    'PAIR7': 3,               // 七对
    'SINGLE': 4,              // 单调
    'H1PAIR7': 5,               // 豪华七对
    'H2PAIR7': 6,               // 双豪华七对

};
//牌型分数
var PatternScore = {};
PatternScore[Pattern.NONE] = 0;
PatternScore[Pattern.NORMAL] = 1;
PatternScore[Pattern.PAIR] = 1;
PatternScore[Pattern.PAIR7] = 1;
PatternScore[Pattern.SINGLE] = 1;
PatternScore[Pattern.H1PAIR7] = 1;
PatternScore[Pattern.H2PAIR7] = 1;
//显示的分数
var ItemScore = {};
ItemScore[ScoreRule.DH] = 0;
ItemScore[ScoreRule.ZM] = 0;
ItemScore[ScoreRule.LZ] = 0;
ItemScore[ScoreRule.GSH] = 0;
ItemScore[ScoreRule.GSP] = 0;
ItemScore[ScoreRule.QG] = 0;
ItemScore[ScoreRule.BT] = 0;
ItemScore[ScoreRule.TH] = 0;
ItemScore[ScoreRule.DIHU] = 0;
ItemScore[ScoreRule.TT] = 0;

ItemScore[ScoreRule.GuJiang] = 1;
ItemScore[ScoreRule.YiZhangYing] = 1;
ItemScore[ScoreRule.SanYuan1] = 1;
ItemScore[ScoreRule.SanYuan2] = 5;
ItemScore[ScoreRule.SanYuan3] = 10;
ItemScore[ScoreRule.SanYuan4] = 30;
ItemScore[ScoreRule.SanFeng1] = 1;
ItemScore[ScoreRule.SanFeng2] = 3;
ItemScore[ScoreRule.SanFeng3] = 7;
ItemScore[ScoreRule.SanFeng4] = 15;
ItemScore[ScoreRule.QueMen1] = 1;
ItemScore[ScoreRule.QueMen2] = 3;


ItemScore[ScoreRule.Pair7] = 1;
ItemScore[ScoreRule.H1Pair7] = 20;
ItemScore[ScoreRule.MenQing] = 1;
ItemScore[ScoreRule.QingYiSe] = 1;
ItemScore[ScoreRule.YiTiaoLong] = 1;

ItemScore[ScoreRule.ZiYiSe] = 50;
ItemScore[ScoreRule.H2Pair7] = 50;
ItemScore[ScoreRule.ZiYiSePair7] = 50;
ItemScore[ScoreRule.QingYiSePair7] = 50;
ItemScore[ScoreRule.QingYiSeH1Pair7] = 50;
ItemScore[ScoreRule.QingYiSeYiTiaoLong] = 50;

var ScoreReason = {
    DH: MJ.Result.DH,  // 点胡/点炮
    ZM: MJ.Result.ZM,  // 自摸/被自摸

    BT: ScoreRule.BT, // 报听
    LZ: ScoreRule.LZ, // 庄家
    QG: ScoreRule.QG, // 抢杠
};


var GangScore = {};
GangScore[MJ.Gang.BA] = 1;
GangScore[MJ.Gang.AN] = 2;
GangScore[MJ.Gang.DIAN] = 1;
GangScore[MJ.Gang.ANS] = 2;

exports.ScoreRule = ScoreRule;
exports.Pattern = Pattern;
exports.PatternScore = PatternScore;
exports.ItemScore = ItemScore;
exports.ScoreReason = ScoreReason;
exports.GangScore = GangScore;
exports.SanFeng = SanFeng;
exports.SanYuan = SanYuan;
exports.ZMSanYuan = ZMSanYuan;
exports.Gap = Gap;
